import {request} from '@/utils/request'
//base url
const BASE_URL = process.env.VUE_APP_API_BASE_URL
const api = {
    list_device_type:'/base_information/list_device_type',
    list_device_grade:'/base_information/list_device_grade',
    list_device_maintenance_type:'/base_information/list_device_maintenance_type',
    list_device_maintenance_project:'/base_information/list_device_maintenance_project',
    list_device_inspection_project:'/base_information/list_device_inspection_project',
    save_warning_time:'/base_information/save_warning_time',
    save_device_type:'/base_information/save_device_type',
    save_device_grade:'/base_information/save_device_grade',
    save_device_maintenance_type:'/base_information/save_device_maintenance_type',
    delete_device_type:'/base_information/delete_device_type',
    list_parts_type:'/base_information/list_parts_type',
    save_parts_type:'/base_information/save_parts_type',
    list_fault_type:'/base_information/list_fault_type',
    save_fault_type:'/base_information/save_fault_type'

}
for (const apiKey in api) {
    api[apiKey] = BASE_URL + api[apiKey];
}

export function save_fault_type(parameter) {
    return request( api.save_fault_type,
        'post',
        parameter,
        // { headers: parameter.headers }
    )

}

export function list_fault_type(parameter) {
    return request( api.list_fault_type,
        'get',
        parameter,
        // { headers: parameter.headers }
    )

}

export function save_parts_type(parameter) {
    return request( api.save_parts_type,
        'post',
        parameter,
        // { headers: parameter.headers }
    )

}

export function list_parts_type(parameter) {
    return request( api.list_parts_type,
        'get',
        parameter,
        // { headers: parameter.headers }
    )

}
export function delete_device_type(parameter) {
    return request( api.delete_device_type,
        'post',
        parameter,
        // { headers: parameter.headers }
    )

}

export function save_device_maintenance_type(parameter) {
    return request( api.save_device_maintenance_type,
        'post',
        parameter,
        // { headers: parameter.headers }
    )

}

export function save_device_grade(parameter) {
    return request( api.save_device_grade,
        'post',
        parameter,
        // { headers: parameter.headers }
    )

}

export function save_device_type(parameter) {
    return request( api.save_device_type,
        'post',
        parameter,
        // { headers: parameter.headers }
    )

}
export function save_warning_time(parameter) {
    return request( api.save_warning_time,
        'post',
        parameter,
        // { headers: parameter.headers }
    )

}

export function list_device_inspection_project(parameter) {
    return request( api.list_device_inspection_project,
        'get',
        parameter,
        // { headers: parameter.headers }
    )

}
export function list_device_maintenance_project(parameter) {
    return request( api.list_device_maintenance_project,
        'get',
        parameter,
        // { headers: parameter.headers }
    )

}
export function list_device_maintenance_type(parameter) {
    return request( api.list_device_maintenance_type,
        'get',
        parameter,
        // { headers: parameter.headers }
    )

}

export function list_device_grade(parameter) {
    return request( api.list_device_grade,
        'get',
        parameter,
        // { headers: parameter.headers }
    )

}

export function list_device_type(parameter) {
    return request( api.list_device_type,
        'get',
        parameter,
        // { headers: parameter.headers }
    )

}
